import request from '@/utils/request'

export default {
  getRoleList(params) {
    return request({
      url: '/system/role/list',
      method: 'get',
      params: params
    })
  },
  getRoleOptions() {
    return request({
      url: '/system/role/options',
      method: 'get'
    })
  },
  createRole(data) {
    return request({
      url: '/system/role/create',
      method: 'post',
      data
    })
  },
  updateRole(data) {
    return request({
      url: `/system/role/update/${data.id}`,
      method: 'put',
      data
    })
  },
  deleteRole(data) {
    return request({
      url: '/system/role/delete',
      method: 'delete',
      data
    })
  },
  getRoleInfo(data) {
    return request({
      url: `/system/role/${data.id}`,
      method: 'get'
    })
  }
}
